import pandas as pd
import numpy as np

##################################################################
# 初赛假数据生成器
##################################################################
OUTPUT_DIR = r'C:\Users\99577\Desktop\huawei\preliminary_round\datasets\data_fake_small'
site_num = 50
client_num = 35
T = 1000

qos_constraint = 250
with open(f"{OUTPUT_DIR}/config.ini", 'wt') as _w:
    _w.write(f"[config]\nqos_constraint={qos_constraint}\n")

site_names = [f'S{i}' for i in range(site_num)]
client_names = [f'C{i}' for i in range(client_num)]

qos_df = pd.DataFrame(np.random.randint(low=0, high=500, size=(site_num, client_num)), columns=client_names)
qos_df['site_name'] = site_names
qos_df = qos_df[['site_name'] + client_names]
qos_df.to_csv(f"{OUTPUT_DIR}/qos.csv", index=False)

site_bandwidth_df = pd.DataFrame({'site_name': site_names,
                                  'bandwidth': np.random.randint(low=5, high=80, size=site_num) * 10000})

site_bandwidth_df.to_csv(f"{OUTPUT_DIR}/site_bandwidth.csv", index=False)

demand_df = pd.DataFrame(np.random.randint(low=200, high=300000, size=(T, client_num)),
                         columns=client_names)
demand_df['mtime'] = 'None'
demand_df = demand_df[['mtime'] + client_names]
demand_df.to_csv(f"{OUTPUT_DIR}/demand.csv", index=False)
